<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>新建页</title>
    <link rel = "stylesheet" th:href = "@{/css/bootstrap4.min.css}"/>
    <script th:src="@{/js/jquery-3.6.0.min.js}"></script>
    <script th:src="@{/js/bootstrap4.min.js}"></script>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
    <a class="navbar-brand" href="#">Navigation</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>

    <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav mr-auto">
            <li class="nav-item active">
                <a class="nav-link" th:href="@{/}">Dashboard<span class="sr-only">(current)</span></a>
            </li>
        </ul>
        <ul class="nav justify-content-end">
            <li class="nav-item">
                <a class="nav-link" th:href="@{/logout}">Log Out</a>
            </li>
        </ul>
    </div>
</nav>
<div class="container">
    <div class="row">
        <div class="col-sm-2">
        </div>
        <div class="col-sm-7">
            <form th:action="@{/news/edit}" method="post">
                <div class="form-group">
                    <input type="hidden" id="id" name="id" th:value="${news.id}">
                </div>
                <div class="form-group">
                    <label for="title">News Title</label>
                    <input type="text" class="form-control" id="title" name="title" th:value="${news.title}" placeholder="please enter the title">
                </div>
                <div class="form-group">
                    <label for="description">News Introduction</label>
                    <input type="text" class="form-control" id="description" name="description" th:value="${news.description}" placeholder="please enter the introduction">
                </div>
                <div class="form-group">
                    <label for="contents">News Contents</label>
                    <textarea class="form-control" id="contents" rows="5"  name="contents" th:value="${news.contents}" placeholder="please enter the contents"></textarea>
                </div>
                <div class="form-group">
                    <button class="btn btn-primary btn-block" type="submit">Submit</button>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>
